(function($){
    $(function(){
        $('#userMsgForm').validator({
           theme:'yellow_right_effect',
           stopOnError: false,
           timely: 1,
           focusCleanup:true,
           fields: {
               'nick': '姓名:required;length[2~20];',
               'phone': '手机号码:required;mobile;',
               'qq': 'QQ号码:required;qq;'
           },
           valid: function(){
               $('#userMsgForm')._ajaxForm(function(r){
                   asyncbox.tips(r.m,r.r ? 'success' : 'error');
                   if(r.r) {
                       setTimeout(function(){
                           document.location.reload();
                       }, 2000);
                   }
               });
           }
        });
    });
})(jQuery);